<!--事前查验打印组件-->
<template>
    <div>
        <div :id="key" align="center" style="height: 100%" :key="key" v-if="show">
            <div style="width: 800px;background-color: white;height: 100%">
                <div style="width: 675px;background-color: white;height: 100%">
                    <div class="title1">
                        沈阳市低保救助服务管理平台对接查验信息
                    </div>
                    <br/>
                    <div align="left" class="content">&nbsp;&nbsp;&nbsp;&nbsp;根据《关于印发《省民政厅创新体制机制优化营商环境措施》的通知》（辽民发〔2020〕64号）、《沈阳市营商环境建设领导小组办公室关于印发沈阳市2020年十五个优化营商环境专项整治行动方案的通知》（沈营商办发〔2020〕1号）有关规定，为进一步简化要件材料，优化审批程序，依法对查验对象的家庭基本情况进行查验。
                        <br/>
                        &nbsp;&nbsp;&nbsp;&nbsp;此查验结果通过与本市相关信息共享单位的数据比对和委托核对机构核对得出。相关审批部门和申请人对查验结果若无疑义，可将此结果存档备案，无需申请人重复提供相应材料。申请人如对查验结果内容有疑义，可向数据来源相应部门确认更新数据。查验内容如确有不符，申请人可向低保审批部门提供合法佐证材料，以备审批部门审核备案。
                    </div>
                    <div align="left" class="title3">
                        <br/>
                        一、查验内容
                    </div>
                    <div align="left" class="content">
                        <br/>1.户籍信息
                    </div>
                    <div>
                        <table border="1" cellspacing="0" cellpadding="0" width="100%">
                            <tr class="table_head" height="40px;">
                                <td align="center">
                                    查验时间
                                </td>
                                <td align="center" style="min-width: 55px">
                                    姓名
                                </td>
                                <td align="center">
                                    身份证号
                                </td>
                                <td align="center">
                                    户籍状态
                                </td>
                                <td align="center">
                                    户籍地址
                                </td>
                                <td align="center">
                                    有无异议
                                </td>
                            </tr>

                            <tr v-for='(item,index) in hjxx' :key="index" class="table_content" height="40px;">
                                <td align="center">
                                    {{item.cysj}}
                                </td>
                                <td align="center">
                                    {{item.xm}}
                                </td>
                                <td align="center">
                                    {{item.sfzh}}
                                </td>
                                <td align="center">
                                    {{item.hjzt}}
                                </td>
                                <td align="center">
                                    {{item.hjdz}}
                                </td>
                                <td align="center">

                                </td>
                            </tr>
                        </table>
                    </div>
                    <div align="left" class="content">
                        <br/>
                        2.残疾人信息
                    </div>
                    <div>
                        <table border="1" cellspacing="0" cellpadding="0" width="100%">
                            <tr class="table_head" height="40px;">
                                <td align="center" width="8%">
                                    查验时间
                                </td>
                                <td align="center" width="10%">
                                    姓名
                                </td>
                                <td align="center" width="8%" class="breakLine">
                                    身份证号
                                </td>
                                <td align="center">
                                    有效期开始
                                </td>
                                <td align="center">
                                    有效期结束
                                </td>
                                <td align="center" width="8%" class="breakLine">
                                    残疾人证号
                                </td>
                                <td align="center">
                                    残疾等级
                                </td>
                                <td align="center">
                                    残疾类别
                                </td>
                                <td align="center">
                                    持证状态
                                </td>
                                <td align="center">
                                    有无异议
                                </td>
                            </tr>

                            <tr v-for='(item,index) in cjrxx' :key="index" class="table_content" height="40px;">
                                <td align="center">
                                    {{item.cysj}}
                                </td>
                                <td align="center" width="10%">
                                    {{item.xm}}
                                </td>
                                <td align="center" width="15%" class="breakLine">
                                    {{item.sfzh}}
                                </td>
                                <td align="center">
                                    {{item.stime}}
                                </td>
                                <td align="center">
                                    {{item.etime}}
                                </td>
                                <td align="center" width="15%" class="breakLine">
                                    {{item.number}}
                                </td>
                                <td align="center">
                                    {{item.level}}
                                </td>
                                <td align="center">
                                    {{item.type}}
                                </td>
                                <td align="center">
                                    {{item.state}}
                                </td>
                                <td align="center">

                                </td>
                            </tr>
                        </table>
                    </div>

                    <div align="left" class="content">
                        <br/>
                        <br/>
                        &nbsp;&nbsp;&nbsp;&nbsp;本结果仅用于最低生活保障救助审核参考，不得作为其他任何用途。
                    </div>
                    <div align="right" class="content">
                        <br/>
                        {{dqsj}}
                    </div>
                </div>
            </div>
        </div>
        <!--    <Button type="success"   @click="goPrint">打印</Button>-->
    </div>
</template>

<script>
    import {postAction} from '@/api/request'
    import print from 'print-js'

    export default {
        name: 'Ss00011Print',
        props: {
            ss12001Id: {
                type: String,
                required: false
            },
        },
        data() {
            return {
                dqsj: '',
                hjxx: [],
                cjrxx: [],
                key: "",
                show: false,
            }
        },
        watch: {},
        methods: {
            goPrint() {
                printJS({
                    printable: this.key,
                    type: 'html',
                    targetStyles: ['*'],
                    scanStyles: false,
                    style: ".title1{font-weight: 700;font-family:FangSong;font-size: 25px;} " +
                    "    .titleJb{font-size: 25px; font-family:FangSong;font-weight:bold;} " +
                    "    .title2{font-size: 20px; font-family:'SimSun';} " +
                    "    .title3{font-size: 25px;font-family:FangSong;font-weight:bold;} " +
                    "    table,table tr th, table tr td { border:1px solid black; } " +
                    "    .content{font-size: 25px;font-family:FangSong;} " +
                    "    .table_head{font-size: 18px;font-family:FangSong;font-weight: bold;} " +
                    "    .table_content{font-size: 14px;font-family:FangSong;} " +
                    "    .PageNext{page-break-after:always;} " +
                    "    .breakLine{word-break: break-all;}"
                })
                this.$emit("changeSubmit");
            },
            edit(ss12001Id) {
                this.show = false;
                postAction("/api/ac/subsistence/ss00011Service/savePrintData", {ss12001Id: ss12001Id}).then((res) => {
                    if (res.data.errcode == 0) {
                        this.cjrxx = res.data.data.cjrxx;
                        this.hjxx = res.data.data.hjxx;
                        this.dqsj = res.data.data.dqsj;
                    }
                }).finally(() => {
                    this.show = true;
                });
            }
        },

    }
</script>
<style media="print">.noprint {
    DISPLAY: none
}</style>
<style scoped>
    /*主标题 */
    .title1 {
        font-family: "FangSong";
        font-size: 25px;
        font-weight: bold;
    }

    .titleJb {
        font-size: 25px;
        font-family: "FangSong";
        font-weight: bold;
    }

    /*副标题 */
    .title2 {
        font-size: 20px;
        font-family: "SimSun";
    }

    /* 子标题 */
    .title3 {
        font-size: 25px;
        font-family: "FangSong";
        font-weight: bold;
    }

    table, table tr th, table tr td {
        border: 1px solid black;
    }

    /* 内容 */
    .content {
        font-size: 25px;
        font-family: "FangSong";
    }

    .table_head {
        font-size: 18px;
        font-family: "FangSong";
        font-weight: bold;
    }

    .table_content {
        font-size: 14px;
        font-family: "FangSong";
    }

    .PageNext {
        page-break-after: always;
    }

    .breakLine {
        word-break: break-all;
    }
</style>
